<template>
  <div class="dashboard-editor-container">
    <div class=" clearfix">
      <pan-thumb :image="avatar?avatar:DefaultAvatar" style="float: left">
        <div>欢迎！</div>
        <div>欢迎！</div>
        <div>热烈欢迎！</div>
      </pan-thumb>

      <div class="info-container">
        <p class="display_name">{{ name }}</p>
        <p class="dis_role">拥有的角色：<span v-for="item in roles" :key="item.id">{{ item.name }} &nbsp;&nbsp;</span></p>
      </div>
    </div>
    <div>
      <img :src="emptyGif" class="emptyGif">
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import PanThumb from '@/components/PanThumb'
import DefaultAvatar from '@/assets/avatar.png'

export default {
  name: 'DashboardAdmin',
  components: { PanThumb },
  data() {
    return {
      DefaultAvatar: DefaultAvatar,
      emptyGif: 'https://wpimg.wallstcn.com/0e03b7da-db9e-4819-ba10-9016ddfdaed3'
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'avatar',
      'roles'
    ])
  }
}
</script>

<style lang="scss" scoped>

  .emptyGif {
    display: block;
    width: 45%;
    margin: 0 auto;
  }

  .dashboard-editor-container {
    background-color: #e3e3e3;
    min-height: 100vh;
    padding: 50px 60px 0px;
    .pan-info-roles {
      font-size: 12px;
      font-weight: 700;
      color: #333;
      display: block;
    }
    .info-container {
      position: relative;
      margin-left: 190px;
      height: 150px;
      .display_name {
        font-size: 48px;
        line-height: 48px;
        color: #212121;
        padding-top: 35px;
        margin:0;
      }
      .dis_role{
        padding: 5px 10px;
        font-size: 16px;
        color:blueviolet;
      }
    }
  }
</style>
